package org.zcl.缓存行;

/**
 * @Package org.zcl.缓存行
 * @PROJECT_NAME: question
 * @DESCRIPTION:
 * @USER: zhuchenglin
 * @DATE: 2022/1/7 9:51
 */
public class CPUCacheLine {

    public static void main(String[] args) {
        int[][] array = new int[64 * 1024][1024];

        // 横向遍历
        for(int i = 0; i < 64 * 1024; i ++)
            for(int j = 0; j < 1024; j ++)
                array[i][j] ++;

        // 纵向遍历
        for(int i = 0; i < 1024; i ++)
            for(int j = 0; j < 64 * 1024; j ++)
                array[j][i] ++;
    }
}
